import Vue from 'vue';
import Router from 'vue-router';
import home from '@/components/home';
import accountManagement from '@/page/account/accountManagement';
import customerList from '@/page/customer/customerList';
import uploadFile from '@/page/uploadFile/approvalFile';
import accountsReceivable from '@/page/project/accountsReceivable';
import projectHome from '@/page/project/projectHome';
import assetMange from '@/page/project/assetMange';
import assetPool from '@/page/project/assetPool';
import centerQuery from '@/page/project/centerQuery';
import centerQueryfile from '@/page/project/centerQueryfile';
import lookcenterQuery from '@/page/project/lookcenterQuery';
import contractsList from '@/page/project/contractsList';
import contractsTerms from '@/page/project/contractsTerms';
import contractsTermsFile from '@/page/project/contractsTermsFile';
import newProject from '@/page/project/newProject';
import moProject from '@/page/project/moProject';
import projectList from '@/page/project/projectList';
import projectCustom from '@/page/project/projectCustom';
import projectMessage from '@/page/project/projectMessage';
import PutMange from '@/page/project/PutMange';
import putPlan from '@/page/project/putPlan';
import receivableDetail from '@/page/project/receivableDetail';
import sendMessage from '@/page/project/sendMessage';
import login from '@/pages/login.vue';
import index from '@/page/common/index.vue'
Vue.use(Router);
export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      redirect: {name: 'index'},
      children: [
        {
          path: 'index',
          name: 'index',
          component: index
        },
        {
          path: '/accountManagement',
          name: 'accountManagement', 
          component: accountManagement
        },
        {
          path: 'enterInfo',
          name: 'enterInfo',
          component: resolve => require(['@/page/common/enterInfo.vue'], resolve)
        },
        {
          path: 'enterInfoSec',
          name: 'enterInfoSec',
          component: resolve => require(['@/page/common/enterInfoSec.vue'], resolve)
        },
        {
          path: '/customer',
          name: 'customer',
          component: resolve => require(['@/page/customer/customer.vue'], resolve)
        },
        {
          path: '/customerList',
          name: 'customerList',
          component: customerList,
          redirect: {name: 'basicInfo'},
          children: [
            {
              path: 'basicInfo',
              name: 'basicInfo',
              component: resolve => require(['@/page/customer/basicInfo.vue'], resolve)
            },
            {
              path: 'business',
              name: 'business',
              component: resolve => require(['@/page/customer/business.vue'], resolve)
            },
            {
              path: 'licenseFile',
              name: 'licenseFile',
              component: resolve => require(['@/page/customer/licenseFile.vue'], resolve)
            },
            {
              path: 'licenses',
              name: 'licenses',
              component: resolve => require(['@/page/customer/licenses.vue'], resolve)
            },
            {
              path: 'litigation',
              name: 'litigation',
              component: resolve => require(['@/page/customer/litigation.vue'], resolve)
            },
            {
              path: 'transaction',
              name: 'transaction',
              component: resolve => require(['@/page/customer/transaction.vue'], resolve)
            },
            {
              path: 'events',
              name: 'events',
              component: resolve => require(['@/page/customer/events.vue'], resolve)
            },
            {
              path: 'picture',
              name: 'picture',
              component: resolve => require(['@/page/customer/picture.vue'], resolve)
            }
          ]         
        },
        {
          path: '/uploadFile',
          name: 'uploadFile',
          component: uploadFile
        },
        {
          path: '/viewFile',
          name: 'viewFile',
          component: resolve => require(['@/page/uploadFile/viewFile'], resolve)
        },
        {
          path: '/projectHome',
          component: projectHome,
          children: [
            {
              path: '/',
              component: projectMessage,
              meta: {
                title: '项目信息'
              }
            },
            {
              path: 'projectMessage',
              name: 'projectMessage',
              component: projectMessage,
              meta: {
                title: '项目信息'
              }
            },
            {
              path: 'sendMessage',
              name: 'sendMessage',
              component: sendMessage,
              meta: {
                title: '发行信息'
              }
            },
            {
              path: 'projectCustom',
              name: 'projectCustom',
              component: projectCustom,
              meta: {
                title: '项目客户'
              }
            },
            {
              path: 'contractsList',
              name: 'contractsList',
              component: contractsList,
              meta: {
                title: '项目合同'
              }
            },
            {
              path: 'accountsReceivable',
              name: 'accountsReceivable',
              component: accountsReceivable,
              meta: {
                title: '应收账款'
              }
            },
            {
              path: 'centerQuery',
              name: 'centerQuery',
              component: centerQuery,
              meta: {
                title: '中登查询'
              }
            },
            {
              path: 'centerQueryfile',
              name: 'centerQueryfile',
              component: centerQueryfile,
              meta: {
                title: '中登查询'
              }
            },
            {
              path: 'lookcenterQuery',
              name: 'lookcenterQuery',
              component: lookcenterQuery,
              meta: {
                title: '中登查询'
              }
            },
            {
              path: 'assetMange',
              name: 'assetMange',
              component: assetMange,
              meta: {
                title: '资产管理'
              }
            },
            {
              path: 'assetPool',
              name: 'assetPool',
              component: assetPool,
              meta: {
                title: '资产管理'
              }
            },
            {
              path: 'receivableDetail',
              name: 'receivableDetail',
              component: receivableDetail,
              meta: {
                title: '应收账款明细'
              }
            },
            {
              path: 'contractsTerms',
              name: 'contractsTerms',
              component: contractsTerms,
              meta: {
                title: '合同条款'
              }
            },
            {
              path: 'contractsTermsFile',
              name: 'contractsTermsFile',
              component: contractsTermsFile,
              meta: {
                title: '合同文件'
              }
            },
            {
              path: 'PutMange',
              name: 'PutMange',
              component: PutMange,
              meta: {
                title: '投放管理'
              }
            },
            {
              path: 'putPlan',
              name: 'putPlan',
              component: putPlan,
              meta: {
                title: '投放计划'
              }
            },
          ]
        },
        {
          path: '/newProject',
          name: 'newProject',
          component: newProject
        },
        {
          path: '/moProject',
          name: 'moProject',
          component: moProject
        },
        {
          path: '/projectList',
          name: 'projectList',
          component: projectList
        },
      ]
    }
  ]
});
